Combined phase and time-of-flight measurement

ABSTRACT

Systems and methods of measuring distance between two wireless devices by combining phase shift and time-of-flight measurements. A first wireless devices sends a first packet to the second wireless device. After receiving the first packet, the second wireless device sending to the first wireless device a second packet. After sending the second packet, the second wireless device sends a first continuous wave signal to the first wireless device. After receiving the first continuous wave signal, the first wireless device sends to the second wireless device a second continuous wave signal. The first wireless device then calculates a time-of-flight measurement based on a time between the first wireless device sending the first packet and receiving the second packet, and calculates a second measurement based on a phase shift of the first continuous wave signal and the second continuous wave signal, and combines the two measurements.

This application claims priority to U.S. Provisional Application No.62/767,971 filed on Nov. 15, 2018, which is incorporated by referenceherein.

BACKGROUND

In some applications it may be necessary to measure the distance to awireless device or between two wireless devices. For example, anautomobile may measure the distance between it and a key fob that isattempting to access the automobile to confirm the proximity of thekeyfob before granting access rights. One such example is a passivekeyless entry system. In order to maximize the accuracy of theestimations, however, multiple measurements on multiple frequencies maybe required, which may require a substantial amount of time and power.Many wireless devices, for example battery powered devices (e.g.,keyfobs), however, may not have the power necessary for the multiplemeasurements to obtain the desired accuracy.

BRIEF DESCRIPTION OF THE DRAWINGS

For a detailed description of various examples, reference will now bemade to the accompanying drawings in which:

FIG. 1 shows an illustrative wireless system for performing the distancemeasurement methods described herein;

FIG. 2 shows a timing diagram for an illustrative distance measurementprotocol; and

FIG. 3 shows an illustrative method for performing the distancemeasurement protocol of FIG. 2.

FIG. 4 shows a timing diagram for an illustrative distance measurementprotocol; and

FIG. 5 shows an illustrative method for performing the distancemeasurement protocol of FIG. 4.

FIG. 6 shows a timing diagram for an illustrative distance measurementprotocol; and

FIG. 7 shows an illustrative method for performing the distancemeasurement protocol of FIG. 6.

SUMMARY

Illustrative methods described herein include a method for measuring adistance between a first wireless device and a second wireless device.The method includes sending a first packet from the first wirelessdevice to the second wireless device and receiving, by the firstwireless device, a second packet from the second wireless device. Themethod also includes receiving, by the first wireless device, a firstcontinuous wave signal from the second wireless device, and sending, bythe first wireless device, a second continuous wave signal to the secondwireless device. The method further includes calculating a firstmeasurement of the distance based on a time between the first wirelessdevice sending the first packet and receiving the second packet, andcalculating a second measurement of the distance based on a phase shiftof the first continuous wave signal and the second continuous wavesignal. The method also includes determining the distance based on thefirst measurement and the second measurement.

Another illustrative method described herein includes a method formeasuring a distance to a wireless device. The method includes sending afirst packet to the wireless device and, after the first packet is sent,receiving a second packet from the wireless device. The method alsoincludes, after receiving the second packet, receiving a firstcontinuous wave signal from the wireless device, and, after receivingthe first continuous wave signal, sending a second continuous wavesignal to the wireless device. The method then includes calculating afirst measurement of the distance based on a time between sending thefirst packet and receiving the second packet and calculating a secondmeasurement of the distance based on a phase shift of the firstcontinuous wave signal and the second continuous wave signal. The methodfurther includes determining the distance based on the first measurementand the second measurement.

Illustrative systems described herein include a system for measuring avalue indicative of distance. The system includes a first wirelessdevice configured to send a first packet, and a second wireless deviceconfigured to receive the first packet and then to send to the firstwireless device a second packet and then a first continuous wave signal.The first wireless device is further configured, upon receiving thefirst continuous wave signal, to send to the second wireless device asecond continuous wave signal. The first wireless device is furtherconfigured to calculate a first measurement based on a time differencebetween sending of the first packet and receiving the second packet, tocalculate a second measurement based on a phase shift of the firstcontinuous wave signal and the second continuous wave signal, and todetermine a distance between the first wireless device and the secondwireless device based on the first measurement and the secondmeasurement.

DETAILED DESCRIPTION

Illustrative methods and systems described herein measure distancebetween wireless devices with increased accuracy and lower powerrequirements. Because the illustrative systems and methods can achieve adesired accuracy with reduced power, they may, for example, beparticularly suited for use with battery powered wireless devices (e.g.,keyfobs).

FIG. 1 shows illustrative wireless communications system 12 havingillustrative wireless communications devices 1 and 2 that are configuredto perform the illustrative reduced-power distance measurementsdescribed herein. Wireless device 1 includes transmitter 3 and receiver5 and wireless device 2 includes transmitter 6 and receiver 4.Transmitters 3 and 6 may be, for example, radio frequency (RF)transmitters. Receivers 5 and 6 may be, for example, RF receivers.Wireless devices 1 and 2 each have an oscillator 8 and 9, respectively,for generating RF signals. Oscillators 8 and 9 may be, for example,phase-locked loops (PLLs) capable of generating sine waves. Wirelessdevice 1 may also include a processor 7, a memory 11 and a clock 10.Wireless device 2 may also include a processor 14, a memory 15 and aclock 17. Processors 7 and 14 may be configured, for example, to performthe distance measurement calculations described herein. Memories 11 and15 include executable instructions 13 and 16, respectively, and maycomprise a non-transitory storage device such as volatile memory (e.g.,random access memory) or non-volatile memory (e.g., read only memory).Wireless device 1 may be, for example, a master device, and wirelessdevice 2 may be, for example, a slave device. Wireless device 2 may be,for example, a keyfob and wireless device 1 may be incorporated into avehicle (e.g., automobile, truck, etc.). It may be desirable for thewireless device 1 to determine, for example, a distance to wirelessdevice 2 to determine if wireless device 2 is close enough to grantaccess permission. If wireless device 1 is incorporated into a vehicle,wireless device 1 may permit the doors to be unlocked and/or the motorto be engaged upon determining that the wireless device 2 issufficiently close to wireless device 1.

One technique for measuring distance between wireless devices (e.g.,wireless communications devices 1 and 2) is a time-of-flightmeasurement. The time-of-flight measurement is based on the time thatelapses between sending a packet to and receiving a packet from awireless device. In a time-of-flight measurement, wireless device 1sends a packet, for example a PING packet, to wireless device 2, whichresponds with another packet, for example an ACK packet. The packets maybe, for example, synchronization word packets. A synchronization wordpacket is a packet that may include a random or pseudo-random bitsequence that is known to wireless device 1 and wireless device 2.Various methods may be used by the devices to generate this sequence,such as linear feedback shift registers (LFSR) or cryptographicgeneration algorithms such as AES. Alternatively, wireless device 1 maysend the sequence to wireless device 2, or vice versa. A synchronizationword packet may have auto-correlation properties that increase thelikelihood of packet detection in the presence of noise.

The initiator of the time-of-flight measurement, in this examplewireless device 1, may use clock 10 to determine the time betweensending the PING packet and receiving the ACK packet. In this regard,processor 7 may count ticks or counts of clock 10, and may convert theticks or counts to time. For example, processor 7 may begin counting thenumber of ticks of clock 10 when the PING packet is sent and may stopcounting the ticks when the ACK packet is received. While the timebetween sending the PING packet and receiving the ACK packet may includethe time that wireless device 2 takes to receive and send the ACKsignal, the time should at least be proportional to the over-the-airroundtrip time and therefore representative of the distance betweenwireless device 1 and wireless device 2. The processor 7 may convert thecalculated time to distance based on, for example, the known propertiesof wireless devices 1 and 2 (e.g., over-the-air speed of the RF signaland propagation delays).

Because times-of-flight for short distances may be relatively small(e.g., in the range of a few nanoseconds), the measurements may beimpacted by any error. It may, therefore, be helpful to repeat thesemeasurements multiple times to increase the accuracy of the results.Similarly, due to dynamic multipath propagation conditions, channelinterference (such as collisions with other wireless standards), andefforts to reduce the impact of these issues, the measurements may besubject to variation. Thus, it may be desirable to repeat thesemeasurements on a number of different channels to increase the accuracy.Such repeated measurements, however, may cause a power burden forwireless devices, particularly for battery-powered wireless devices.

Another technique for measuring distance involves measuring the phaseshift of incoming signals. In an exemplary implementation of thistechnique, processor 7 of wireless device 1 instructs oscillator 8 togenerate a continuous wave signal (CW), which may be an unmodulated RFcarrier signal. Transmitter 3 of wireless device 1 receives the CW fromoscillator 8 and sends the CW to wireless device 2. Receiver 4 ofwireless device 2 detects the CW and measures the frequency of the CWand the phase of the CW with respect to a local phase of oscillator 9,which receiver 4 received from oscillator 9. Receiver 4 then providesthe measured values to processor 14. Processor 14 then instructsoscillator 9 to generate a CW with the same frequency and phase as theCW received from wireless device 1, and that CW is then sent to wirelessdevice 1. Wireless device 2 then sends local phase information towireless device 1 by any known method (e.g., Bluetooth, WiFi, wiredconnection, etc.). Using its own local phase information and the localphase information received from wireless device 2, wireless device 1then uses processor 7 to calculate the phase shift of a received CW,which will be the same for both CWs in the exchange.

As stated above, a CW sent from wireless device 1 to wireless device 2will have its local phase shifted or rotated by the same amount as a CWtraveling from wireless device 2 to wireless device 1. Receiver 5 ofwireless device 1 measures the phase of the incoming CW with respect tothe local phase of the oscillator 8. Similarly, receiver 4 of wirelessdevice 2 measures the phase of the incoming CW with respect to the localphase of the oscillator 9. The relationship of the measured phases andof the incoming CWs to both local oscillator phases and and the phaseshift between devices may be defined as follows:

ϕ₁=ψ₂+θ−ψ₁

ϕ₂=ψ₁+θ−ψ₂

where ϕ₁ and ϕ₂ are the phases of the incoming CWs measured at wirelessdevices 1 and 2, respectively, θ is phase shift as the CW travelsbetween devices and ψ₁ and ψ₂ are the local phases of oscillators 8 and9, respectively. After wireless device 2 sends the measured ϕ₂ towireless device 1, wireless device 1 can calculate the phase shift θ byusing the following equation, which is a combination of the two aboveequations:

$\theta = \frac{\Phi_{1} + \Phi_{2}}{2}$

The phase shift or rotation of the RF signal as it travels between thedevices is proportional to the distance between the devices. The phaseshift θ of a CW between wireless device 1 and wireless device 2 may alsobe expressed as:

$\theta = {\frac{2\pi \; {fr}}{c}{mod}\mspace{14mu} 2\pi}$

where c is the speed of light, f is the frequency of the CW and r is thedistance between the devices. Using this equation, the distance betweenthe devices can be expressed as:

$r = {\frac{c\; \theta}{2\pi \; f}{mod}\frac{c}{f}}$

Due to the spatial periodicity of the RF signals, a single phase shiftmeasurement at a single frequency may be able to determine a precisedistance once an approximate distance is known. However, because sometechniques are unable to distinguish between phase shifts that areseparated by multiples of half the CW period, a single measurement mayyield multiple possible locations, each separated by a half wavelengthof the CW. If the RF carrier signal is, for example, in the 2.4 GHzindustrial, scientific and medical (ISM) band and the distance isconsidered in bins of about 6 cm, a single measurement may determinewhere the distance falls within a bin but be unable to determine whichbin the distance falls in. Multiple measurements in multiple frequenciesmay be necessary to compensate for these issues, thereby requiring morepower to calculate distance with a desired accuracy. Where two differentCW exchanges are performed using different two different frequencies,the distance may be calculated using the following equation:

$r = {\frac{c\; {\Delta\theta}}{2{\pi\Delta}\; f}{mod}\frac{c}{\Delta \; f}}$

where Δθ is the difference in the two measured phase shifts for CWs intwo different CW exchanges and Δf is the difference between thefrequencies. Thus, the bin size increases, and with a Δf ofapproximately 1 MHz, the distance r may be able to be determined withina bin of around 300 meters. Thus, two measurements provide increasedrange compared to a single measurement, but even these two measurementsmay not provide sufficient accuracy as they are still subject to theinherent inaccuracies of phase shift measurements.

Illustrative methods and systems described below and in the figuresprovide measurements with increased accuracy and/or range by combiningphase shift and time-of-flight measurements in ways that provideincreased accuracy, range and/or flexibility. Combining phase andtime-of-flight measurements provides an improved measurement because onemeasurement protocol may compensate for the deficiencies of the other.For example, phase shift measurements are less vulnerable to device orpropagation variations than are time-of-flight measurements. Incontrast, phase shift measurements, unlike time-of-flight measurements,are subject to periodicity and may be reliant on precise oscillatorsthat may be impacted by noise or drift.

FIG. 2 shows a timing diagram for an illustrative distance measuringprotocol that combines the time-of-flight and phase shift protocolsdescribed above, and FIG. 3 shows the steps for performing themeasurement protocol. In step 30, wireless devices 1 and 2 may lock theoutputs of oscillators 8 and 9, respectively to a desired commonfrequency. In step 31, wireless device 1 generates a PING packet 21 andat T₀ transmitter 3 sends the PING packet 21 to wireless device 2. PINGpacket 21 may be, for example, a synchronization word packet. Processor7 may begin counting ticks from clock 10 at, for example, time T₀.Receiver 4 of wireless device 2 begins to receive the PING packet 21 atT₁. Step 31 may alternatively occur before step 30, but step 30 shouldbe timed to allow sufficient time for the oscillators to settle in tothe desired frequency before sending a CW. In step 32, processor 7 ofwireless device 1 instructs oscillator 8 to generate CW 22, and at T₂transmitter 3 sends CW 22, which receiver 4 of wireless device 2 beginsreceiving at T₃. Although the receiver 4 is shown receiving the PINGpacket 21 (at time T₁) before the transmitter 3 sends the CW 22 (at timeT₂), depending on the distance between the transmitter 3 and thereceiver 4, time T₁ may occur well after time T₂ in other examples.

In step 33, at T₄ wireless device 1 switches from transmitter mode toreceiver mode, and wireless device 2 switches from receiver mode totransmitter mode, during which a switch time T_(sw) elapses. Switchingbetween transmitter and receiver modes may involve powering down a poweramplifier in transmitter 3 used to produce the CW and power up a lownoise amplifier in receiver 4 used to receive the CW, and vice versa.The switching may also involve enabling and disabling of transmitter andreceiver logic, while also maintaining the oscillator locked at thedesired frequency. Thus, switching may be time consuming and powerintensive. In step 34, receiver 4 measures the frequency and phase of CW22 with respect the local phase of oscillator 9 and provides thesemeasurements to processor 14. Processor 14 then instructs oscillator 9to generate CW 23 based on the measured frequency and phase of CW 22. AtT₅ transmitter 6 of wireless device 2 sends CW 23 to receiver 5 ofwireless device 1, which begins receiving CW 23 at T₆.

In step 35, processor 14 of wireless device 2 generates anacknowledgment (ACK) packet 24, which may be a synchronization wordpacket. At T₇ transmitter 6 sends ACK packet 24 to receiver 5 ofwireless device 1, which receives ACK packet 24 at T₈ causing processor7 to stop counting the ticks of clock 10. Although the receiver 5 isshown receiving the CW 23 (at time T₆) before the transmitter 6 sendsthe ACK packet 24 (at time T₇), depending on the distance between thetransmitter 6 and the receiver 5, time T₆ may occur well after time T₇in other examples.

Processor 7 may store the number of counted ticks that represent thetime-of-flight measurement in memory 11. In step 36, wireless device 2sends the measured phase ϕ₂ of CW 22 to wireless device 1 by any knownmethod (e.g., Bluetooth, WiFi, wired connection, etc.). In step 37,processor 7 of wireless device 1 calculates the phase shift θ using themeasured phase ϕ₁ of CW 23 and the measured phase ϕ₂ of CW 22 receivedfrom wireless device 2, and may convert the recorded tick count to time.One or both of the phase shift and tick count (or time) may be convertedto a distance measurement. In step 38, processor 7 combines the phaseshift measurement and the time-of-flight measurement calculated in step37 by, for example, calculating an average or weighted average of themeasurements depending on which of time-of-flight or phase shift shouldbe accorded more weight. The measurements may also be compared and thediscarded if not within a chosen range and/or of the same order ofmagnitude.

The measurement protocol described in FIGS. 2 and 3 increases accuracyand energy efficiency of measurements by combining phase andtime-of-flight measurements to reduce the number of receiver/transmitterswitches. The protocol described in FIGS. 2 and 3, however, need not beperformed as many times as either time-of-flight or phase differencealone for the same accuracy level, and therefore may achieve the same,or better, level of accuracy with the same or fewer number ofmeasurements. Because wireless device 2 device reads and generates theCWs “back-to-back”—i.e., generates its own CW after receiving andreading the CW from the wireless device 1 without any packet exchange inbetween, the oscillator 9 of the wireless device 2 may remain lockedduring the role switch, thereby eliminating the need to restart theoscillator and lock into a frequency, reducing time and powerconsumption. In addition, because the devices send the time-of-flightpacket and CWs “back-to-back,” a switch time may be avoided betweensigning those signals. The steps of FIG. 3 may be performed multipletimes, and the results averaged, to increase the accuracy.

FIG. 4 shows a timing diagram for another illustrative distancemeasuring protocol that combines the time-of-flight and phase shiftmeasurements described above, and FIG. 5 shows the steps for performingthe measurement protocol. In step 50, wireless devices 1 and 2 may lockthe outputs of oscillators 8 and 9, respectively to a desired commonfrequency. In step 51, wireless device 1 generates a PING packet 41 andat T₀ transmitter 3 sends PING packet 41 to wireless device 2. Processor7 may begin counting ticks from clock 10 at, for example, time T₀, andreceiver 4 of wireless device 2 begins receiving the PING packet 41 atT₁. PING packet 41 may be, for example, a synchronization word packet.Step 50 may alternatively be performed at any point before step 55below, and should be timed to allow sufficient time for the oscillatorsto settle in to the desired frequency before sending a CW. In step 52,at T₂ wireless devices 1 switches from transmitter mode to receivermode, and wireless device 2 switches from receiver mode to transmittermode, during which a first switch time T_(sw1) elapses. In step 53,processor 14 of wireless device 2 generates an ACK packet 42, which maybe a synchronization word packet. At T₃ transmitter 6 sends the ACKpacket 42 to receiver 5 of wireless device 1, which receives the ACKpacket 42 at T₄ causing processor 7 to stop counting the ticks of clock10. Processor 7 may store the number of counted ticks that represent thetime-of-flight measurement in memory 11. In step 54, at T₅ wirelessdevices 1 then switches from receiver mode to transmitter mode, andwireless device 2 switches from transmitter mode to receiver mode,during which a second switch time elapses (T_(sw2)).

In step 55, processor 7 of wireless device 1 instructs oscillator 8 togenerate a CW 43 and at T₆ transmitter 3 sends CW 43 to receiver 4 ofwireless device 2, which begins receiving CW 43 at T₇. In step 56, at T₈wireless device 1 switch from transmitter mode to receiver mode, andwireless device 2 switches from receiver mode to transmitter mode,during which a third switch time T_(sw3) elapses. In step 57, receiver 4measures the frequency and phase of CW 43 with respect to a local phaseof oscillator 9 and provides these measurements to processor 14.Processor 14 then instructs oscillator 9 to generate CW 44 based on themeasured frequency and phase of CW 43. At T₉, transmitter 5 of wirelessdevice 2 sends CW 44 to receiver 5 of wireless device 1, which beginsreceiving CW 44 at T₁₀.

In step 58, wireless device 2 sends the measured phase ϕ₂ of CW 43 towireless device 1 by any known method (e.g., Bluetooth, WiFi, wiredconnection, etc.). In step 59, processor 7 of wireless device 1calculates the phase shift θ using the measured phase ϕ₁ of CW 44 andthe measured phase ϕ₂ of CW 43, and may convert the recorded tick countto time. One or both of the phase shift and tick count (or time) may beconverted to a distance measurement. In step 60, processor 7 combinesthe phase shift measurement and the time-of-flight measurementcalculated in step 59 by, for example, calculating an average orweighted average of the measurements depending on which oftime-of-flight or phase shift should be accorded more weight. Themeasurements may also be compared and the discarded if not within achosen range and/or of the same order of magnitude.

The measurement protocol described in FIGS. 4 and 5 also increasesaccuracy of measurements by combining phase and time-of-flightmeasurements. The steps of FIG. 5 may be performed multiple times, andthe results averaged, to increase the accuracy of the measurement.Moreover, additional PING/ACK packet exchanges 45 or CW exchanges 46 maybe added in any order. For example, three PING/ACK packet 45 exchangesmay be performed for each CW exchange 46. In this way, the protocol andmethod described in FIGS. 4 and 5 provide flexibility to modify themeasurement protocol based on the requirements.

FIG. 6 shows a timing diagram for another illustrative distancemeasuring protocol that combines the time-of-flight and phase shiftprotocols described above, and FIG. 7 shows the steps for performing themeasurement protocol. In step 70, wireless devices 1 and 2 may lock theoutputs of oscillators 8 and 9, respectively to a desired commonfrequency. In step 71, wireless device 1 generates a PING packet 61 andat T₀ transmitter 3 sends PING packet 61 to wireless device 2. Processor7 may begin counting ticks from clock 10 at, for example, time T₀, andreceiver 4 of wireless device 2 begins receiving the PING packet 61 atT₁. PING packet 61 may be, for example, a synchronization word packet.Step 70 may alternatively be performed at any point before step 74below, but step 70 should be timed to allow sufficient time for theoscillators to settle in to the desired frequency before sending a CW.In step 72, at T₂ wireless device switches from transmitter mode toreceiver mode, and wireless device 2 switches from receiver mode totransmitter mode, during which a first switch time T_(sw1) elapses.

In step 73, processor 14 of wireless device 2 generates an ACK packet62, which may be a synchronization word packet. At T₃ transmitter 6sends ACK packet 62 to receiver 5 of wireless device 1, which receivesACK packet 62 at T₈ causing processor 7 to stop counting the ticks ofclock 10. Processor 7 may store the number of counted ticks thatrepresent the time-of-flight measurement in memory 11. In step 74,processor 14 of wireless device 2 instructs oscillator 9 to generate aCW 63 and at T₅ transmitter 6 sends CW 63 to receiver 5 of wirelessdevice 1, which begins receiving CW 63 at T₆. Although the receiver 5 isshown receiving the ACK packet 62 (at time T₄) before the transmitter 6sends the CW 63 (at time T₅), depending on the distance between thetransmitter 6 and the receiver 5, time T₄ may occur well after time T₅in other examples. In step 75, at T₇ wireless device 2 switches fromtransmitter mode to receiver mode, and wireless device 1 switches fromreceiver mode to transmitter mode, during which a second switch timeT_(sw2) elapses.

In step 76, receiver 5 measures the frequency and phase of CW 63 andprovides these measurements to processor 7. Processor 7 then instructsoscillator 8 to generate CW 64 based on the measured frequency and phaseof CW 63. At T₈, transmitter 3 of wireless device 1 sends CW 64 toreceiver 4 of wireless device 2, which begins receiving CW 64 at T₉. Instep 77, wireless device 2 sends the measured phase ϕ₂ of CW 64 towireless device 1 by any known method (e.g., Bluetooth, WiFi, wiredconnection, etc.). Step 77 may instead occur before step 75 or beforestep 76. In step 78, processor 7 of wireless device 1 calculates thephase shift θ using the measured phase ϕ₁ of CW 63 and the measuredphase ϕ₂ of CW 64 received from wireless device 2, and may convert therecorded tick count to time. One or both of the phase shift and tickcount (or time) may be converted to a distance measurement. In step 78,processor 7 combines the phase shift measurement and the time-of-flightmeasurement calculated in step 77 by, for example, calculating anaverage or weighted average of the measurements depending on which oftime-of-flight or phase shift should be accorded more weight. Themeasurements may also be compared and the discarded if not within achosen range and/or of the same order of magnitude.

The protocol described in FIGS. 6 and 7 is similar to the protocoldescribed in FIGS. 4 and 5 except that, for example, in the protocol ofFIGS. 6 and 7 wireless device 2 sends the first CW (63) of the phasemeasurement exchange, whereas in the protocol described in FIGS. 4 and 5wireless device 1 sends the first CW (43) of the phase measurementexchange. Wireless device 2 sending the first CW (63) allows theprotocol of FIGS. 6 and 7 to avoid a switch time between steps 73 and74, thereby further increasing efficiency and reducing powerconsumption. Like the example protocols of the previous figures, theprotocol of FIGS. 6 and 7 also increases accuracy and energy efficiencyof measurements by combining phase and time-of-flight measurements toreduce the number of receiver/transmitter switches. The steps of FIG. 7may be performed multiple times, and the results averaged, to increasethe accuracy of the measurement.

The time periods described above in FIGS. 2, 4 and 6 generally occur inthe order of the numbered subscript, except as expressly describedotherwise herein. For example, To generally occurs before T₁. In each ofthe switch times T_(sw), T_(sw1), T_(sw2), T_(sw3) discussed above andshown in FIGS. 2, 4 and 6, wireless devices 1 and 2 may begin the switchsimultaneously, or one of the devices may begin to switch before theother. In addition, the wireless device that sent the immediatelypreceding communication may begin the switch before the other device hascompleted reception of that communication. T_(sw), T_(sw1), T_(sw2),T_(sw3) each represents a general time period for switching fromreceiving to transmitter and vice versa, and may all the same, or one ormore may be different. The steps described above as being performed byprocessors 7 and 14 may be performed by executing the executableinstructions 13 and 16, respectively.

Modifications are possible in the described embodiments, and otherembodiments are possible, within the scope of the claims.

What is claimed is:
 1. A method for measuring a distance between a firstwireless device and a second wireless device, the method comprising:sending a first packet from the first wireless device to the secondwireless device; receiving, by the first wireless device, a secondpacket from the second wireless device; receiving, by the first wirelessdevice, a first continuous wave signal from the second wireless device;sending, by the first wireless device, a second continuous wave signalto the second wireless device; calculating a first measurement of thedistance based on a time between the first wireless device sending thefirst packet and receiving the second packet; calculating a secondmeasurement of the distance based on a phase shift of the firstcontinuous wave signal and the second continuous wave signal; anddetermining the distance based on the first measurement and the secondmeasurement.
 2. The method of claim 1, further comprising locking afirst frequency of a first oscillator in the first wireless device and asecond frequency of a second oscillator in the second wireless devicebefore sending the first packet.
 3. The method of claim 2, furthercomprising maintaining the first oscillator at the first frequency andmaintaining the second oscillator at the second frequency betweensending the first packet and sending the first continuous wave signal.4. The method of claim 1, wherein the calculating of the first andsecond measurements is performed by the first wireless device.
 5. Themethod of claim 1, wherein the determining the distance comprisescombining the first and second measurements.
 6. The method of claim 5,wherein the combining of the first and second measurements comprises theaveraging the first and second measurements.
 7. The method of claim 1,wherein the calculating of the first measurement comprises convertingthe time to a first distance.
 8. The method of claim 1, wherein thefirst wireless device sends the first packet and receives the secondpacket before receiving the first continuous wave signal.
 9. The methodof claim 1, further comprising: sending a third packet from the firstwireless device to the second wireless device; receiving, by the firstwireless device, a fourth packet from the second wireless device;calculating a third measurement based on a time between the firstwireless device sending the first packet and receiving the secondpacket.
 10. The method of claim 9, further comprising: sending a thirdcontinuous wave signal from the second wireless device to the firstwireless device; receiving, by the first wireless device, a fourthcontinuous wave signal from the second wireless device; calculating afourth measurement based on a phase shift of the third continuous wavesignal and the fourth continuous wave signal; and calculating a seconddistance measurement based on the first measurement, second measurement,third measurement and fourth measurement.
 11. A method for measuring adistance to a wireless device, the method comprising: sending a firstpacket to the wireless device; after the first packet is sent, receivinga second packet from the wireless device; after receiving the secondpacket, receiving a first continuous wave signal from the wirelessdevice; after receiving the first continuous wave signal, sending asecond continuous wave signal to the wireless device; calculating afirst measurement of the distance based on a time between sending thefirst packet and receiving the second packet; calculating a secondmeasurement of the distance based on a phase shift of the firstcontinuous wave signal and the second continuous wave signal; anddetermining the distance based on the first measurement and the secondmeasurement.
 12. The method of claim 11, wherein the calculating of thefirst measurement comprises converting the time to first distance. 13.The method of claim 11, further comprising locking a first frequency ofa first oscillator in the first wireless device and a second frequencyof a second oscillator in the second wireless device before sending thefirst packet.
 14. The method of claim 13, further comprising maintainingthe first oscillator at the first frequency and maintaining the secondoscillator at the second frequency between sending the first packet andsending the first continuous wave signal.
 15. The method of claim 11,wherein the calculating of the first and second measurements isperformed by the first wireless device.
 16. The method of claim 11,wherein the determining the distance comprises combining the first andsecond measurements.
 17. A system for measuring a value indicative ofdistance, the system comprising: a first wireless device configured tosend a first packet; and a second wireless device configured to receivethe first packet and then to send to the first wireless device a secondpacket and then a first continuous wave signal, wherein the firstwireless device is further configured, upon receiving the firstcontinuous wave signal, to send to the second wireless device a secondcontinuous wave signal, and wherein the first wireless device is furtherconfigured to calculate a first measurement based on a time differencebetween sending of the first packet and receiving the second packet, tocalculate a second measurement based on a phase shift of the firstcontinuous wave signal and the second continuous wave signal, and todetermine a distance between the first wireless device and the secondwireless device based on the first measurement and the secondmeasurement.
 18. The system of claim 17, wherein the first wirelessdevice comprises a first oscillator configured to generate the secondcontinuous wave signal and the second wireless device comprises a secondoscillator configured to generate the first continuous wave signal,wherein the first and second oscillators are configured to maintainfirst and second frequencies, respectively, in the time between sendingthe first packet and sending the first continuous wave signal.
 19. Thesystem of claim 17, wherein the second wireless device is a keyfob. 20.The system of claim 17, wherein first wireless is an automobile.